﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data ;
using HA.Data;
namespace HA.ModFlow.Controls.Converts
{
    class ConvertContourType:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ContourDisplayType type = (ContourDisplayType)value;
            string str = "";
            switch (type)
            {
                case ContourDisplayType.Linear :
                    str= "Linear";
                    break;
                case ContourDisplayType.ColorFill:
                    str = "Color Fill";
                    break;
                case ContourDisplayType.LinearAndColorFill:
                    str = "Linear and Color Fill";
                    break;
            }
            return str;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string str = (string)value;
            ContourDisplayType type=ContourDisplayType.Linear ;
            switch (str)
            {
                case "Linear":
                    type = ContourDisplayType.Linear;
                    break;
                case "Color Fill":
                    type = ContourDisplayType.ColorFill;
                    break;
                case "Linear and Color Fill":
                    type = ContourDisplayType.LinearAndColorFill;
                    break;
            }
            return type;
        }
    }
}
